+function ($) { "use strict";

    var ClickShow = function (element) {
        this.$element = $(element);
        this.options  = $.extend({}, ClickShow.DEFAULTS);
    }

    ClickShow.DEFAULTS = {
        hideclass:'hide'
    }

    ClickShow.prototype.init = function () {
        var $target = $(this.$element.data('target'));
        var _self = this;

        this.$element.addClass(this.options.hideclass);
        $target.on('click', function(e){
            $target.addClass(_self.options.hideclass);
            _self.$element.removeClass(_self.options.hideclass);
            e.preventDefault();
        });

        this.$element.find('[data-toggle="clickshow.hide_this"]').on('click', function(){
            $target.removeClass(_self.options.hideclass);
            _self.$element.addClass(_self.options.hideclass);
            e.preventDefault();
        });
    };

    var old = $.fn.ClickShow;

    $.fn.ClickShow = function (option) {
        return this.each(function () {
            var c = new ClickShow(this);
            c.init();
        })
    }

    $.fn.ClickShow.Constructor = ClickShow;

    $.fn.ClickShow.noConflict = function () {
        $.fn.ClickShow = old
        return this
    }

    $('[data-toggle=clickshow]', document).ClickShow();

}(window.jQuery);